package com.abi${classpath}.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * ${targetDesc}管理
 * </p>
 *
 * @author Andy.Tan
 */
@Slf4j
@RestController
@RequestMapping("${targetName_iii}")
@Api(tags = "${targetDesc}管理")
public class ${targetName_Iii}Controller {

    @Autowired
    private ${targetName_Iii}Service ${targetName_iii}Service;


    @ApiOperation("新增${targetDesc}")
    @PostMapping("add${targetName_Iii}")
    public BaseResponse add${targetName_Iii}(@Validated @RequestBody Add${targetName_Iii}Req add${targetName_Iii}Req) throws Exception{
        //新增${targetDesc}
        ${targetName_iii}Service.add${targetName_Iii}(add${targetName_Iii}Req);
        //包装出参
        return BaseResponse.create();
    }

    @ApiOperation("编辑${targetDesc}")
    @PostMapping("update${targetName_Iii}")
    public BaseResponse update${targetName_Iii}(@Validated @RequestBody Update${targetName_Iii}Req update${targetName_Iii}Req) throws Exception{
        //编辑${targetDesc}
        ${targetName_iii}Service.update${targetName_Iii}(update${targetName_Iii}Req);
        //包装出参
        return BaseResponse.create();
    }

    @ApiOperation("分页查询${targetDesc}")
    @GetMapping("list${targetName_Iii}")
    public BaseResponse<List${targetName_Iii}Res> list${targetName_Iii}(@Validated List${targetName_Iii}Req list${targetName_Iii}Req) throws Exception{
        //分页查询${targetDesc}
        List${targetName_Iii}Res result = ${targetName_iii}Service.list${targetName_Iii}(list${targetName_Iii}Req);
        //包装出参
        return BaseResponse.create(result);
    }

    @ApiOperation("查询${targetDesc}明细")
    @GetMapping("get${targetName_Iii}")
    public BaseResponse<Get${targetName_Iii}Res> get${targetName_Iii}(@Validated Get${targetName_Iii}Req get${targetName_Iii}Req) throws Exception{
        //查询${targetDesc}明细
        Get${targetName_Iii}Res result = ${targetName_iii}Service.get${targetName_Iii}(get${targetName_Iii}Req);
        //包装出参
        return BaseResponse.create(result);
    }

    @ApiOperation("${targetDesc}启用")
    @PostMapping("enable${targetName_Iii}")
    public BaseResponse enable${targetName_Iii}(@Validated @RequestBody Enable${targetName_Iii}Req enable${targetName_Iii}Req) throws Exception{
        //${targetDesc}启用
        ${targetName_iii}Service.enable${targetName_Iii}(enable${targetName_Iii}Req);
        //包装出参
        return BaseResponse.create();
    }

    @ApiOperation("${targetDesc}禁用")
    @PostMapping("disable${targetName_Iii}")
    public BaseResponse disable${targetName_Iii}(@Validated @RequestBody Disable${targetName_Iii}Req disable${targetName_Iii}Req) throws Exception{
        //${targetDesc}禁用
        ${targetName_iii}Service.disable${targetName_Iii}(disable${targetName_Iii}Req);
        //包装出参
        return BaseResponse.create();
    }

}








